module Main where
 
import qualified Hw1 as H
import Text.Printf
 
main :: IO ()
main = do 
	putStrLn(printf "rectangle sides: %d" (H.sides (H.rectangle 2 3)))
	putStrLn(printf "rtTriangle sides: %d" (H.sides (H.rtTriangle 2 3)))
	putStrLn(printf "Polygon sides with 0 vertexes: %d" (H.sides (H.Polygon [])))
	putStrLn(printf "Polygon sides with 1 vertexes: %d" (H.sides (H.Polygon [(1.1, 1.1)])))
	putStrLn(printf "Polygon sides with 2 vertexes: %d" (H.sides (H.Polygon [(1.1, 1.1),(1.2, 1.2)])))
	putStrLn(printf "Polygon sides with 4 vertexes: %d" (H.sides (H.Polygon [(1.1, 1.1),(1.2, 1.2),(1.3, 1.3),(1.4, 1.4)])))
	putStrLn(printf "Ellipse: %d" (H.sides (H.Ellipse 1.1 1.1)))
	H.hanoi 2 "a" "b" "c"
	H.sierpinskiCarpet
	putStrLn(printf "lengthNonRecrusive []: %d" (H.lengthNonRecrusive []))
	putStrLn(printf "lengthNonRecrusive [1,2,3,4]: %d" (H.lengthNonRecrusive ["1","2","3","4"]))
	putStrLn(printf "doubleEach [1,2,3,4] %s" (show (H.doubleEach [1,2,3,4])))
	putStrLn(printf "doubleEachNonRecursive [1,2,3,4] %s" (show (H.doubleEachNonRecursive [1,2,3,4])))
	putStrLn(printf "pairAndOne [1,2,3,4] %s" (show (H.pairAndOne [1,2,3,4])))
	putStrLn(printf "pairAndOneNonRecursive [1,2,3,4] %s" (show (H.pairAndOneNonRecursive [1,2,3,4])))
	putStrLn(printf "addEachPair [(1,2),(2,3),(3,4),(4,5)] %s" (show (H.addEachPair [(1,2),(2,3),(3,4),(4,5)])))
	putStrLn(printf "addEachPairNonRecursive [(1,2),(2,3),(3,4),(4,5)] %s" (show (H.addEachPairNonRecursive [(1,2),(2,3),(3,4),(4,5)])))
	putStrLn(printf "minList [1,5,2,3,0,6,2] %s" (show (H.minList [1,5,2,3,0,6,2])))
	putStrLn(printf "minListNonRecursive [1,5,2,3,0,6,2] %s" (show (H.minListNonRecursive [1,5,2,3,0,6,2])))
	putStrLn(printf "maxList [1,5,2,3,0,6,2] %s" (show (H.maxList [1,5,2,3,0,6,2])))
	putStrLn(printf "maxListNonRecursive [1,5,2,3,0,6,2] %s" (show (H.maxListNonRecursive [1,5,2,3,0,6,2])))
	putStrLn(printf "fringe (Branch (Branch (Leaf 1) (Leaf 2)) (Leaf 3)) %s" (show (H.fringe (H.Branch (H.Branch (H.Leaf 1) (H.Leaf 2)) (H.Leaf 3)))))
	putStrLn(printf "treeSize (Branch (Branch (Leaf 1) (Leaf 2)) (Leaf 3)) %s" (show (H.treeSize (H.Branch (H.Branch (H.Leaf 1) (H.Leaf 2)) (H.Leaf 3)))))
	putStrLn(printf "treeHeight (Branch (Branch (Leaf 1) (Leaf 2)) (Leaf 3)) %s" (show (H.treeHeight (H.Branch (H.Branch (H.Leaf 1) (H.Leaf 2)) (H.Leaf 3)))))
	let t = (let t' = (let t'' = H.IBranch 1 H.ILeaf H.ILeaf in H.IBranch 2 t'' t'') in H.IBranch 3 t' t') in do
		putStrLn(printf "takeTree 0 (Branch 3 (Branch 2 (Branch 1 Leaf Leaf)) (Branch 2 (Branch 1 Leaf Leaf))) %s" (show (H.takeTree 0 t)))
		putStrLn(printf "takeTree 1 (Branch 3 (Branch 2 (Branch 1 Leaf Leaf)) (Branch 2 (Branch 1 Leaf Leaf))) %s" (show (H.takeTree 1 t)))
		putStrLn(printf "takeTree 2 (Branch 3 (Branch 2 (Branch 1 Leaf Leaf)) (Branch 2 (Branch 1 Leaf Leaf))) %s" (show (H.takeTree 2 t)))
		putStrLn(printf "takeTree 3 (Branch 3 (Branch 2 (Branch 1 Leaf Leaf)) (Branch 2 (Branch 1 Leaf Leaf))) %s" (show (H.takeTree 3 t)))
		putStrLn(printf "takeTreeWhile (> 2) (Branch 3 (Branch 2 (Branch 1 Leaf Leaf)) (Branch 2 (Branch 1 Leaf Leaf))) %s" (show (H.takeTreeWhile (>2) t)))
	putStrLn(printf "myMap (\\x -> x + x) [1,2,3,4] %s" (show (H.myMap (\x -> x + x) [1,2,3,4])))
	H.mainXML